package Magnitudes;

import junit.framework.TestCase;

import org.junit.Test;

public class PercentageTest extends TestCase {

	Percentage percentageToTest = new Percentage(5);

	@Test
	public void testGivenAPercentageWhithAmmount5WhenToStringIsCalledShouldReturnAString5Percent() {

		String stringReturned = percentageToTest.toString();

		assertEquals("5.0%", stringReturned);
	}

	@Test
	public void testGivenAPercentageWithAmmount5WhenAmmountIsCalledShouldReturn5float() {

		double amountReturned = percentageToTest.amount();

		assertEquals(5.0, amountReturned);

	}

}
